package com.soryin.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 用户
 * @author Hello_海生
 * @date 2014年3月6日
 */
@Entity
@Table(name="Soryin_User")
public class User {
	private long id;
	private String photo;			//用户头像
	private String name;			//用户昵称
	private String email;			//用户邮箱（账号）
	private String password;		//用户密码
	private Set<OpenPlatform> ops= new HashSet<OpenPlatform>();	//用户开发平台账号

	@Id
	@GeneratedValue
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}
	
	@OneToMany(mappedBy="userId",cascade = { CascadeType.ALL})
	public Set<OpenPlatform> getOps() {
		return ops;
	}

	public void setOps(Set<OpenPlatform> ops) {
		this.ops = ops;
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	
	
}
